<template>
  <div>
    <div class="row" v-if="userData != undefined">
      <div class="col-lg-3 col-md-3">
        <div class="iq-counter text-center iq-box-shadow iq-counter-style-1">
          <div class="counter-content">
            <p class="iq-counter-info">
              <span class="timer" data-to="80" data-speed="5000">{{
                userData.total_num
              }}</span>
              <span class="counter-after-content"></span>
              <!-- <span class="counter-symbol">+</span> -->
            </p>
            <h5 class="counter-title-text">交易总订单</h5>
          </div>
        </div>
      </div>
      <div class="col-lg-3 col-md-3">
        <div class="iq-counter text-center iq-box-shadow iq-counter-style-1">
          <div class="counter-content">
            <p class="iq-counter-info">
              <span class="timer" data-to="30" data-speed="5000"
                >{{ userData.match_num }}单</span
              >
              <span class="counter-after-content"></span>
              <!-- <span class="counter-symbol">+</span> -->
            </p>
            <h5 class="counter-title-text">撮合订单</h5>
          </div>
        </div>
      </div>
      <div class="col-lg-3 col-md-3">
        <div class="iq-counter text-center iq-box-shadow iq-counter-style-1">
          <div class="counter-content">
            <p class="iq-counter-info">
              <span class="timer" data-to="10" data-speed="5000"
                >{{ userData.no_match_num }}单</span
              >
              <span class="counter-after-content"></span>
              <!-- <span class="counter-symbol">+</span> -->
            </p>
            <h5 class="counter-title-text">未撮合订单</h5>
          </div>
        </div>
      </div>
      <div class="col-lg-3 col-md-3">
        <div class="iq-counter text-center iq-box-shadow iq-counter-style-1">
          <div class="counter-content">
            <p class="iq-counter-info">
              <span class="timer" data-to="18520" data-speed="5000"
                >{{ Math.trunc(userData.trade_amount / 1000) }}元</span
              >
              <span class="counter-after-content"></span>
              <!-- <span class="counter-symbol">+</span> -->
            </p>
            <h5 class="counter-title-text">交易总额</h5>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
// 引入swiper插件的js
import { getUserTradeInfo } from "../../../api/link";
export default {
  data() {
    return {
      userData: undefined,
    };
  },
  mounted() {
    getUserTradeInfo().then((res) => {
      this.userData = res.data;
    });
  },
  methods: {},
};
</script>

